﻿using Abp.Dependency;
using Abp.Events.Bus.Exceptions;
using Abp.Events.Bus.Handlers;
using Abp.UI;
using Serilog;

namespace Hicap.AuthorizationServer.Core
{
    public class ExceptionHandle : IEventHandler<AbpHandledExceptionData>, ITransientDependency
    {
        public void HandleEvent(AbpHandledExceptionData eventData)
        {
            Log.Error(eventData.Exception, "Error--");
            throw new UserFriendlyException(eventData.Exception.Message);
        }
    }
}